from enum import Enum

class Type(Enum):
    DEFAULT = 0
    IF = 1
    ELIF = 2
    LOOP = 3
    VAR  = 4
    STAT = 5
    MACRO = 6


class Op:
    stat = []
    def __init__(self):
        self.complete = False
        self.stat = []

class StatOp(Op):
    def OpType(self):
        return Type.STAT

class LoopOp(Op):
    def __init__(self, start, end, step):
        super().__init__()
        self.start = start
        self.end = end
        self.step = step 

    def OpType(self):
        return Type.LOOP

class VarOp(Op):
    def __init__(self, name, value):
        Op.__init__(self)
        self.name = name
        self.value = value

    def OpType(self):
        return Type.VAR
    
class ElifOp(Op):
    def __init__(self):
        super().__init__()

    def OpType(self):
        return Type.ELIF

class IfOp(Op):
    elif_op = ElifOp()
    def __init__(self, lParam, operator, rParam):
        super().__init__()
        self.lParam = lParam
        self.operator = operator
        self.rParam = rParam

    def OpType(self):
        return Type.IF
    

class MacroOp(Op):
    def __init__(self, name, params):
        super().__init__()
        self.name = name
        self.params = params

    def OpType(self):
        return Type.MACRO

class Func(Op):
    ops = []
    vars_def = {}
    def __init__(self, name, params):
        super().__init__()
        self.name = name
        self.params = params


class FileParse:
    funcs = []
    ops = []
    stats = []
    op_flag = False
    def __init__(self):
        self.funcs = []
        self.ops = []


class Deck:
    vars_define = {}
    proc_func_flag = False
    func_var_defines = {}
    formal_real_params = {}
    output = []
    
        
